#ifndef FUNC_EXSPIFALSH_DEMO_H
#define FUNC_EXSPIFALSH_DEMO_H

#include "bsp_spiflash1.h"
#include "api_spiflash_ex.h"
typedef struct {
	u8 song_index;
}song_info_t;


typedef struct {
    u16 total_num;
    u16 cur_num;
    u8  pause;
	u8 vol_adjust;
	u8 need_adjust;
	u8 adjust_cnt;
	u16 time_offset;
	u16 timeout_cnt;
	u16 max_timeout_cnt;	
	u8 song_mode:4;
	u8 song_index:4;
	u8 longkey_wakeup:1;
	u16 play_time;
	u8 tick_start;
	u32 song_ticks;
	u32 ticks_1;
	song_info_t song_info[3];
} demo_msc_t;
typedef struct {
u16 start_time;	
u16 end_time;	
u32 frame_count;            //current frame count
u32 file_ptr;               //file ptr of current frame
}demo_play_time_info_t;
typedef struct {
	u16 time;	
	u8 light_mode;	
}song_time_play_t;

extern demo_msc_t demo_msc;


void func_exspiflash_demo_message(u16 msg);
void register_spi_read_function(int (* read_func)(void *buf, u32 addr, u32 len));
void func_exspifalsh_demo_message(u16 msg);

void func_demo_check_timeout(void);
void func_demo_sfx_ctl(void);
void demo_switch_song(void);
void demo_switch_mic_onoff(u8 onoff);



#endif


